package library.operation.impl;

import library.book.BookList;
import library.operation.IOperation;

/**
 * 借阅书籍操作
 */
public class BorrowOperation implements IOperation {
    @Override
    public void work(BookList bookList) {
        System.out.println("此时您正在进行的是借阅书籍操作~");
        System.out.println("请您输入要借阅书籍的名称:");
        String booksName=scanner.next();

        if (bookList.isContains(booksName)){
            bookList.borrowBook(booksName);
            System.out.println("书籍借阅成功~");
        }else{
            System.out.println("书籍还为上架，请过一段时间再来看看~~~");
        }
    }
}
